package com.wsjj.yjh.server.impl;
import com.wsjj.yjh.bean.HiveTable;
import com.wsjj.yjh.bean.LinuxShellTable;
import com.wsjj.yjh.mapper.HiveTableMapper;
import com.wsjj.yjh.mapper.LinuxShellTableMapper;
import com.wsjj.yjh.server.HiveTableServer;
import com.wsjj.yjh.server.LinuxShellTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class HiveTableServerImpl implements HiveTableServer {

    @Autowired
    private HiveTableMapper HiveTableMapper;


    @Override
    public HiveTable selectById() {
        Integer coumt = HiveTableMapper.selectCoumt();
        Random random = new Random();
        int id = random.nextInt(coumt);

        return HiveTableMapper.selectById(id+1);
    }
}
